<?php

namespace tjsd\view\managers;

/**
 * 
 * 
 * @author Jakub Tesárek <info@tjsd.cz>
 * @copyright 2012
 * @version 1.0
 */
class SmartyViewManager implements \tjsd\view\ViewManager {
	protected $smarty;
	protected $container;
	
	public function __construct() {
		$this->smarty = new \Smarty();
		$this->smarty->debugging = true;
		$this->smarty->caching = true;
		$this->smarty->cache_lifetime = 120;
	}
	
	public function display() {
		$this->smarty->display('index.tpl');
	}

	public function getContainer() {
		if(empty($this->container)) {
			$this->container = new SmartyViewContainer($this->smarty);
		}
		return $this->smarty;
	}
}